Objectives: To study how reproductive risks and perinatal outcomes are associated with postpartum depression treated in specialised healthcare defined according to the International Classification of Diseases (ICD)-10 codes, separately among women with and without a history of depression. Design: A retrospective population-based case–control study. Setting: Data gathered from three national health registers for the years 2002−2010. Participants: All singleton births (n=511 422) in Finland. Primary outcome measures: Prevalence of postpartum depression and the risk factors associated with it. Results: In total, 0.3% (1438 of 511 422) of women experienced postpartum depression, the prevalence being 0.1% (431 of 511 422) in women without and 5.3% (1007 of 18 888) in women with a history of depression. After adjustment for possible covariates, a history of depression was found to be the strongest risk factor for postpartum depression. Other strong predisposing factors for postpartum depression were fear of childbirth, caesarean birth, nulliparity and major congenital anomaly. Specifically, among the 30% of women with postpartum depression but without a history of depression, postpartum depression was shown to be associated with fear of childbirth (adjusted OR (aOR 2.71, 95% CI 1.98 to 3.71), caesarean birth (aOR 1.38, 95% CI 1.08 to 1.77), preterm birth (aOR 1.65, 95% CI 1.08 to 2.56) and major congenital anomaly (aOR 1.67, 95% CI 1.15 to 2.42), compared with women with no postpartum depression and no history of depression. Conclusions: A history of depression was found to be the most important predisposing factor of postpartum depression. Women without previous episodes of depression were at an increased risk of postpartum depression if adverse events occurred during the course of pregnancy, especially if they showed physician-diagnosed fear of childbirth.